import { default as request,cloud} from '@/framework/utils/request'

// 创建或者查询会话
export function chatGroupQueryApi (query) {
  return request({
    url: cloud.business +'/chat/group/query',
    method: 'get',
    params: query
  })
}

//游客创建或查询回话
export function chatGroupQueryVisitorApi (query) {
  return request({
    url: cloud.business +'/chat/group/visitor/query',
    method: 'get',
    params: query
  })
}
// 游客查询聊天记录
export function chatHistoryListVisitorApi (query) {
  return request({
    url: cloud.business +'/chat/visitor/history/list',
    method: 'get',
    params: query
  })
}
// 查询聊天人员记录
export function chatHistoryListApi (query) {
  return request({
    url: cloud.business +'/chat/history/list',
    method: 'get',
    params: query
  })
}

// 查询聊天记录
export function chatHistoryPageApi (query) {
  return request({
    url: cloud.business +'/chat/history/page',
    method: 'get',
    params: query
  })
}

// 刪除聊天人员记录
export function chatHistoryDelApi (query) {
  return request({
    url: cloud.business +'/chat/history/del',
    method: 'post',
    data: query
  })
}

// 撤回聊天人员记录
export function chatHistoryRevokeApi (query) {
  return request({
    url: cloud.business +'/chat/history/revoke',
    method: 'post',
    data: query
  })
}

// 新建群组
export function chatGroupAddApi (query) {
  return request({
    url: cloud.business +'/chat/group/add',
    method: 'post',
    data: query
  })
}

// 修改群组名字
export function chatGroupEditApi (query) {
  return request({
    url: cloud.business +'/chat/group/edit',
    method: 'post',
    data: query
  })
}

// 群组详情
export function chatGroupInfoApi (query) {
  return request({
    url: cloud.business +'/chat/group/info',
    method: 'get',
    params: query
  })
}

// 解散群组
export function chatGroupDelApi (query) {
  return request({
    url: cloud.business +'/chat/group/del',
    method: 'post',
    data: query
  })
}

// 群组添加/删除成员
export function chatGroupMemberApi (query) {
  return request({
    url: cloud.business +'/chat/group/member',
    method: 'post',
    data: query
  })
}

// 退出群组
export function chatGroupExitApi (query) {
  return request({
    url: cloud.business +'/chat/group/exit',
    method: 'post',
    data: query
  })
}
// 设置管理员
export function chatGroupAdminApi (query) {
  return request({
    url: cloud.business +'/chat/group/admin',
    method: 'post',
    data: query
  })
}

// 获取组织树(懒加载)
export function getOrgTreeApiLazy (params) {
  return request({
    url: cloud.usercenter +'/hrOrganization/roleBindOrgScopeLazyAntdv/V2',
    method: 'get',
    params
  })
}
// 获取组织树
export function getOrgTreeApi (params) {
  return request({
    url: cloud.usercenter +'/hrOrganization/listTree/V2',
    method: 'get',
    params
  })
}
// 获取组织下的人员
export function getSysUserPageApi (params) {
  return request({
    url: cloud.usercenter +'/sysUser/page/V2',
    method: 'get',
    params
  })
}